#ifndef RESULTRECORD_H
#define RESULTRECORD_H

#include "ASTM.h"

class ResultRecord : public ASTM
{
public:
    enum ResultFlag {
        Normal = 0,
        High,
        Low,
        Positive,
        WeakPositive,
        Negative,
        Error,
        Unknow
    };
    ResultRecord();

    QString buildRecord() const;
    bool analyzeRecord(const QString &str);

public:
    /// 分帧序号,不分帧是总为1
    int frameIndex = 1;
    /// 项目代码
    QString projectName;
    /// 测试结果值（最多四位小数）
    QString result;
    /// 测试项目的单位
    QString unit;
    /// 参考值下限
    QString rangeLower;
    /// 参考值上限
    QString rangeUpper;
    /// 测试时间
    QString testDateTime;
    /// 结果标志
    ResultFlag flag = ResultFlag::Unknow;
    /// 结果提示
    QString resultTip;

private:
    QStringList flagList = {"M", "H", "L", "P", "W", "N", "E", "U"};
};

#endif // RESULTRECORD_H
